#define  _CRT_SECURE_NO_WARNINGS 1
//最大公约数和最小公倍数（函数）
int a(int z, int p)
{
	int t = 0;
	while (t = z % p)
	{
		z = p;
		p = t;
	}
	return p;
}
int main() {
	int x = 0, y = 0;
	int t = 0;
	int h;
	scanf("%d %d", &x, &y);
	int b = a(x, y);
	h = (x * y) / b;
	printf("最大公约数是:%d\n最小公倍数是:%d", b, h);
	return 0;
}

#include<stdio.h>
int main()
{
	int x;
	int y;
	int t;
	scanf("%d %d", &x, &y);
	while (t=x%y)
	{
		x = y;
		y = t;
	}
	printf("%d\n", y);
}